// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './vuex'

// 添加mockjs拦截请求，模拟返回服务器数据
// import mock from './api/mock'
require('./api/mock')
// import MintUI
import { Swipe, SwipeItem, Popup, Loadmore } from 'mint-ui'
Vue.component(Swipe.name, Swipe)
Vue.component(SwipeItem.name, SwipeItem)
Vue.component(Popup.name, Popup)
Vue.component(Loadmore.name, Loadmore)

// inject http request
import axios from './utils/api'
// 使用defineProperty的方法，保证$axios是只读的。不可被修改
Object.defineProperty(Vue.prototype, '$axios', { value: axios })

// 调整窗口大小
import { rem } from './utils/rem'
rem(document, window)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
